<template>
    <view>
        <template v-for="(item, index) in UartPTZTourList">
            <j-cell-group :key="index" :title="'巡航路线' + index">
                <template v-for="(pro, size) in item">
                    <j-cell-card :key="pro.size" :title="'巡航路线配置' + size" :show="false" :is-touch="false" border style="background: #f5f7fb">
                        <j-cell title="巡航路线的名称" :tips="pro.Name" :more="false"></j-cell>
                        <template v-for="(art, num) in pro.Tour">
                            <j-cell-card :key="art.num" :title="'预置点参数配置' + num" :show="false" :is-touch="false" border style="background: #f5f7fb">
                                <j-cell title="预置点名称" :tips="art.Name" :more="false"></j-cell>
                                <j-cell title="预置点停留时间" :tips="art.Time" :more="false"></j-cell>
                            </j-cell-card>
                        </template>
                    </j-cell-card>
                </template>
            </j-cell-group>
        </template>
    </view>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            UartPTZTourList: [],

            pro: {
                size: '',
                Name: '',
                Tour: []
            },

            size: '',

            art: {
                num: '',
                Name: '',
                Time: ''
            },

            num: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
		this.token = options.token
		this.getPreset();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getPreset() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'Uart.PTZTour'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                console.log(result);
                uni.hideLoading({
                    success: (res) => {
                        this.UartPTZTourList = result['Uart.PTZTour']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
